import request from '@/utils/request'

const api_name_hosp = '/admin/hosp/hospital'
const api_name_dict = '/admin/cmn/dict'
const api_name_dep = '/admin/hosp/department'

export default {
  //医院列表
  getHospList(page, limit, searchObj) {
    return request({
      url: `${api_name_hosp}/list/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },

  //更新上线状态
  updateStatus(id, status) {
    return request({
      url: `${api_name_hosp}/updateStatus/${id}/${status}`,
      method: 'get'
    })
  },

  //查询dictCode查询下级数据字典
  findByDictCode(dictCode) {
    return request({
      url: `${api_name_dict}/findByDictCode/${dictCode}`,
      method: 'get'
    })
  }
  ,

  //根据id查询下级数据字典
  findByParentId(dictCode) {
    return request({
      url: `${api_name_dict}/findChildData/${dictCode}`,
      method: 'get'
    })
  },

  //查看医院详情
  getHospById(id) {
    return request({
      url: `${api_name_hosp}/showHospDetail/${id}`,
      method: 'get'
    })
  },

  ////医院排班
  getDeptByHoscode(hoscode) {
    return request({
      url: `${api_name_dep}/getDepList/${hoscode}`,
      method: 'get'
    })
  },

  //查询预约规则
  getScheduleRule(page, limit, hoscode, depcode) {
    return request({
      url: `/admin/hosp/schedule/getScheduleRule/${page}/${limit}/${hoscode}/${depcode}`,
      method: 'get'
    })
  },
  //查询排班详情
  getScheduleDetail(hoscode, depcode, workDate) {
    return request({
      url: `/admin/hosp/schedule/getScheduleDetail/${hoscode}/${depcode}/${workDate}`,
      method: 'get'
    })
  }

}

